// $Id$
package cz.pd.projectbuilder.main.gui.panel;

import cz.pd.projectbuilder.main.listener.InfoListener;
import cz.pd.projectbuilder.main.util.ListenersUtils;
import java.beans.Beans;
import javax.swing.JPanel;

/**
 *
 * @author diblik
 * @version $Revision$
 */
public class InfoPanel extends JPanel {

  /** Creates new form InfoFrame */
  public InfoPanel() {
    initComponents();
    if (!Beans.isDesignTime()) {
      ListenersUtils.addListener(new InfoListener() {

        @Override
        public void showInfo(String info) {
          outputArea.append("\n");
          outputArea.append(info);
        }

        @Override
        public void clear() {
          outputArea.setText("");
        }
      });
    }
  }

  /** This method is called from within the constructor to
   * initialize the form.
   * WARNING: Do NOT modify this code. The content of this method is
   * always regenerated by the Form Editor.
   */
  @SuppressWarnings("unchecked")
  // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
  private void initComponents() {
    java.awt.GridBagConstraints gridBagConstraints;

    jScrollPane1 = new javax.swing.JScrollPane();
    outputArea = new javax.swing.JTextArea();

    setLayout(new java.awt.GridBagLayout());

    jScrollPane1.setName("jScrollPane1"); // NOI18N

    outputArea.setColumns(20);
    outputArea.setFont(new java.awt.Font("Monospaced", 0, 11));
    outputArea.setRows(5);
    outputArea.setName("outputArea"); // NOI18N
    jScrollPane1.setViewportView(outputArea);

    gridBagConstraints = new java.awt.GridBagConstraints();
    gridBagConstraints.gridx = 0;
    gridBagConstraints.gridy = 1;
    gridBagConstraints.fill = java.awt.GridBagConstraints.BOTH;
    gridBagConstraints.weightx = 1.0;
    gridBagConstraints.weighty = 1.0;
    add(jScrollPane1, gridBagConstraints);
  }// </editor-fold>//GEN-END:initComponents

  // Variables declaration - do not modify//GEN-BEGIN:variables
  private javax.swing.JScrollPane jScrollPane1;
  private javax.swing.JTextArea outputArea;
  // End of variables declaration//GEN-END:variables
}
